$(function(){
    "use strict";
    let zz_wtht = []
    let zz_mxb = []
    let wt_wtht = []
    let wt_mxb = []
    let jz_wtht = []
    let jz_mxb = []
    let hz_wtht = []
    let hz_mxb = []
    let jf = []
    let bab = []
    let jhrws = []
    let lxjys = []
    let js_add = []
    let js_edit = []
    let lz_add = []
    let lz_edit = []
    let dy_add = []
    let dy_edit = []

    // 进来就获取技术领域
    $.ajax({
        url:'http://jk.com/Admin/Project/proTechList',
        type:'post',
        success:function(data){
            if(data.code==1){
                let datas = data.res
                let htmls = ''
                for(let i = 0; i < datas.length; i++){
                    htmls += `
                            <li class="js_hidden_list" data-value="${datas[i].tech_id}">
                                <span class="establishment_info_14_text">${datas[i].tech_name}</span>
                                <i class="iconfont icon-fangxiangyou js_hidden_list_logo"></i>
                            </li>
                        `
                }
                htmls += `
                        <div class="js_hidden_box_zi">
                        </div>
                    `

                $('.js_hidden_box').html(htmls)
            }
        }
    })
    let href = window.location.href;
    let hrefINdex = href.indexOf('=');
    if(hrefINdex>0){
        var pro_id = href.substring(hrefINdex+1);
    }
    if(pro_id){
        $.ajax({
            url:'http://jk.com/Admin/Project/projectB',
            type:'post',
            data:{
                pro_id: pro_id
            },
            success:function(data){
                if(data.code==1){
                    let datas = data.res
                    $('#project_num').val(datas.pro_sn)
                    $('#project_name').val(datas.pro_name)

                    //资本化费用化
                    $('#expend_box').attr('data-value',datas.pro_type)
                    let pro_type = $('#expend_box').children('li')
                    if( datas.pro_type == 0 ){
                        for(let type = 0; type < pro_type.length; type++){
                            if($(pro_type[type]).children('span').text()=='费用化'){
                                $(pro_type[type]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                                $(pro_type[type]).parent().siblings('div').removeClass('active')
                            }else{
                                $(pro_type[type]).children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                            }
                        }
                    }else{
                        for(let type = 0; type < pro_type.length; type++){
                            if($(pro_type[type]).children('span').text()=='资本化'){
                                $(pro_type[type]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                                $(pro_type[type]).parent().siblings('div').addClass('active')
                                $('#switch').attr('data-value',datas.stage_distinguish)
                                if(datas.stage_distinguish==0){
                                    $('#switch').children('i').removeClass('active')
                                }else{
                                    $('#switch').children('i').addClass('active')
                                    $('#switch').siblings('ul').addClass('active')
                                    $('#Research_startTime').val(datas.re_start)
                                    $('#Research_endTime').val(datas.re_end)
                                    $('#Development_startTime').val(datas.de_start)
                                    $('#Development_endTime').val(datas.de_end)
                                }
                            }else{
                                $(pro_type[type]).children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                            }
                        }
                    }

                    //研发形式
                    $('#typeChoose').attr('data-value',datas.pro_method)
                    let pro_method = $('#typeChoose').children('li')
                    $(pro_method[datas.pro_method]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                    $(pro_method[datas.pro_method]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                    $('#typeChoose').siblings(`[lll=${datas.pro_method}]`).addClass('active')
                    $('#typeChoose').siblings(`[lll=${datas.pro_method}]`).siblings('div').removeClass('active')
                    if( datas.pro_method == 0 ){//自主研发
                        // 委托研发
                        let zz_chooseWT = $('#zz_chooseWT').children('li')
                        $('#zz_chooseWT').attr('data-value',datas.trust_inc)
                        $(zz_chooseWT[datas.trust_inc]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                        $(zz_chooseWT[datas.trust_inc]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                        if( datas.trust_inc == 1 ){//不含委托研发
                            $('#zz_chooseWT').siblings().removeClass('active')
                        }else{//含委托研发
                            $('#zz_chooseWT').siblings().addClass('active')
                            //境外境内
                            $('#zz_chooseWT').attr('data-value',datas.area)
                            let zz_chooseArea = $('#zz_chooseArea').children('li')
                            $(zz_chooseArea[datas.area]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                            $(zz_chooseArea[datas.area]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                            //委托单位
                            $('#zz_WTcompany').val(datas.com_name)
                            //委托研发合同
                            // $('#zz_WTcontract').val(datas.trust_contact)
                            $('#zz_WTcontract').parent().siblings('span').html(datas.trust_contact_name+'<i class="iconfont icon-delete delete_logo"></i>')
                            zz_wtht.push(datas.trust_contact)
                            zz_wtht.push(datas.trust_contact_name)
                            zz_wtht.push(datas.trust_contact_size)
                            //关联关系
                            $('#zz_Relation_choose').attr('data-value',datas.relation)
                            let zz_Relation_choose = $('#zz_Relation_choose').children('li')
                            $(zz_Relation_choose[datas.relation]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                            $(zz_Relation_choose[datas.relation]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                            if( datas.relation == 0 ){//存在关联关系
                                $('#zz_Relation_choose').parent().siblings().addClass('active')
                                //明细表
                                // $('#zz_Relation').val(datas.fee_desc)
                                $('#zz_Relation').parent().siblings('span').html(datas.fee_desc_name+'<i class="iconfont icon-delete delete_logo"></i>')
                                zz_mxb.push(datas.fee_desc)
                                zz_mxb.push(datas.fee_desc_name)
                                zz_mxb.push(datas.fee_desc_size)
                            }else{//不存在关联关系
                                $('#zz_Relation_choose').parent().siblings().removeClass('active')
                            }

                        }
                    }else if( datas.pro_method == 1 ){//委托研发
                        //境外境内
                        $('#wt_chooseArea').attr('data-value',datas.area)
                        let wt_chooseArea = $('#wt_chooseArea').children('li')
                        $(wt_chooseArea[datas.area]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                        $(wt_chooseArea[datas.area]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                        //委托单位
                        $('#wt_chooseArea').val(datas.com_name)
                        //委托研发合同
                        // $('#wt_chooseArea').val(datas.trust_contact)
                        $('#wt_chooseArea').parent().siblings('span').html(datas.trust_contact_name+'<i class="iconfont icon-delete delete_logo"></i>')
                        wt_wtht.push(datas.trust_contact)
                        wt_wtht.push(datas.trust_contact_name)
                        wt_wtht.push(datas.trust_contact_size)
                        //关联关系
                        $('#zz_Relation_choose').attr('data-value',datas.relation)
                        let zz_Relation_choose = $('#zz_Relation_choose').children('li')
                        $(zz_Relation_choose[datas.relation]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                        $(zz_Relation_choose[datas.relation]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                        if( datas.relation == 0 ){//存在关联关系
                            $('#wt_Relation_choose').parent().siblings().addClass('active')
                            //明细表
                            // $('#wt_Relation_choose').val(datas.fee_desc)
                            $('#wt_Relation_choose').parent().siblings('span').html(datas.fee_desc_name+'<i class="iconfont icon-delete delete_logo"></i>')
                            wt_mxb.push(datas.fee_desc)
                            wt_mxb.push(datas.fee_desc_name)
                            wt_mxb.push(datas.fee_desc_size)
                        }else{//不存在关联关系
                            $('#wt_Relation_choose').parent().siblings().removeClass('active')
                        }
                    }else if( datas.pro_method == 2 ){//集中研发
                        // 委托研发
                        let jz_chooseWT = $('#jz_chooseWT').children('li')
                        $('#jz_chooseWT').attr('data-value',datas.trust_inc)
                        $(jz_chooseWT[datas.trust_inc]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                        $(jz_chooseWT[datas.trust_inc]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                        if( datas.trust_inc == 1 ){//不含委托研发
                            $('#jz_chooseWT').siblings().removeClass('active')
                        }else{//含委托研发
                            $('#jz_chooseWT').siblings().addClass('active')
                            //境外境内
                            $('#jz_chooseWT').attr('data-value',datas.area)
                            let jz_chooseArea = $('#jz_chooseArea').children('li')
                            $(jz_chooseArea[datas.area]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                            $(jz_chooseArea[datas.area]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                            //委托单位
                            $('#jz_WTcompany').val(datas.com_name)
                            //委托研发合同
                            // $('#jz_WTcontract').val(datas.trust_contact)
                            $('#jz_WTcontract').parent().siblings('span').html(datas.trust_contact_name+'<i class="iconfont icon-delete delete_logo"></i>')
                            jz_wtht.push(datas.trust_contact)
                            jz_wtht.push(datas.trust_contact_name)
                            jz_wtht.push(datas.trust_contact_size)
                            //关联关系
                            $('#jz_Relation_choose').attr('data-value',datas.relation)
                            let jz_Relation_choose = $('#jz_Relation_choose').children('li')
                            $(jz_Relation_choose[datas.relation]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                            $(jz_Relation_choose[datas.relation]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                            //集团公司
                            $('#jz_group').val(datas.jthz_name)

                            if( datas.relation == 0 ){//存在关联关系
                                $('#jz_Relation_choose').parent().siblings().addClass('active')
                                //明细表
                                // $('#jz_Relation').val(datas.fee_desc)
                                $('#jz_Relation').parent().siblings('span').html(datas.fee_desc_name+'<i class="iconfont icon-delete delete_logo"></i>')
                                jz_mxb.push(datas.fee_desc)
                                jz_mxb.push(datas.fee_desc_name)
                                jz_mxb.push(datas.fee_desc_size)
                            }else{//不存在关联关系
                                $('#jz_Relation_choose').parent().siblings().removeClass('active')
                            }
                        }
                    }else if( datas.pro_method == 3 ){//合作研发
                        // 委托研发
                        let hz_chooseWT = $('#hz_chooseWT').children('li')
                        $('#hz_chooseWT').attr('data-value',datas.trust_inc)
                        $(hz_chooseWT[datas.trust_inc]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                        $(hz_chooseWT[datas.trust_inc]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                        if( datas.trust_inc == 1 ){//不含委托研发
                            $('#hz_chooseWT').siblings().removeClass('active')
                        }else{//含委托研发
                            $('#hz_chooseWT').siblings().addClass('active')
                            //境外境内
                            $('#hz_chooseWT').attr('data-value',datas.area)
                            let hz_chooseArea = $('#hz_chooseArea').children('li')
                            $(hz_chooseArea[datas.area]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                            $(hz_chooseArea[datas.area]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                            //委托单位
                            $('#hz_WTcompany').val(datas.com_name)
                            //委托研发合同
                            // $('#hz_WTcontract').val(datas.trust_contact)
                            $('#hz_WTcontract').parent().siblings('span').html(datas.trust_contact_name+'<i class="iconfont icon-delete delete_logo"></i>')
                            hz_wtht.push(datas.trust_contact)
                            hz_wtht.push(datas.trust_contact_name)
                            hz_wtht.push(datas.trust_contact_size)
                            //关联关系
                            $('#hz_Relation_choose').attr('data-value',datas.relation)
                            let hz_Relation_choose = $('#hz_Relation_choose').children('li')
                            $(hz_Relation_choose[datas.relation]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                            $(hz_Relation_choose[datas.relation]).siblings().children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                            //合作公司
                            $('#hz_group').val(datas.jthz_name)

                            if( datas.relation == 0 ){//存在关联关系
                                $('#hz_Relation_choose').parent().siblings().addClass('active')
                                //明细表
                                // $('#hz_Relation').val(datas.fee_desc)
                                $('#hz_Relation').parent().siblings('span').html(datas.fee_desc_name+'<i class="iconfont icon-delete delete_logo"></i>')
                                hz_mxb.push(datas.fee_desc)
                                hz_mxb.push(datas.fee_desc_name)
                                hz_mxb.push(datas.fee_desc_size)
                            }else{//不存在关联关系
                                $('#hz_Relation_choose').parent().siblings().removeClass('active')
                            }
                        }
                    }

                    //技术领域
                    $('#technology_area').children('span').text(datas.tec_name)
                    window.sessionStorage['tech_id'] = datas.tech_id

                    //经费
                    $('#Monty_ALLbudget').val(datas.pro_total)
                    // $('#Monty_ALLbudget_file').val(datas.pro_total_file)
                    $('#Monty_ALLbudget').siblings('div').children('span').html(datas.pro_total_file_name+'<i class="iconfont icon-delete delete_logo"></i>')
                    jf.push(datas.pro_total_file)
                    jf.push(datas.pro_total_file_name)
                    jf.push(datas.pro_total_file_size)

                    //项目状态
                    let pro_status = $('#development_progress').children('li')
                    $('#development_progress').attr('data-value',datas.pro_status)
                    if(datas.pro_status==0){
                        $(pro_status[0]).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
                    }else{
                        $(pro_status[1]).children('i').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
                    }

                    //研发机构
                    $('#development_mechanism').val(datas.pro_jigou)
                    //主要内容
                    $('#mainContent').val(datas.pro_content)
                }
            }
        })

        $.ajax({
            url:'http://jk.com/Admin/Project/projectA',
            type:'post',
            data:{pro_id: pro_id},
            success:function(data){
                if(data.code==1){
                    let datas = data.res
                    $('#Application_people').val(datas.apply_user)
                    $('#Application_time').val(datas.apply_time)
                    $('#conduct_startTime').val(datas.pro_start)
                    $('#conduct_endTime').val(datas.pro_end)
                    $('#Application_baogao').parent().siblings('span').html(datas.tax_reduce_recorder_name+'<i class="iconfont icon-delete delete_logo"></i>')
                    bab = []
                    bab.push(datas.tax_reduce_recorder)
                    bab.push(datas.tax_reduce_recorder_name)
                    bab.push(datas.tax_reduce_recorder_size)
                    $('#Application_Prospectus').parent().siblings('span').html(datas.apply_plan_name+'<i class="iconfont icon-delete delete_logo"></i>')
                    jhrws = []
                    jhrws.push(datas.apply_plan)
                    jhrws.push(datas.apply_plan_name)
                    jhrws.push(datas.apply_plan_size)
                    $('#Application_Resolution').parent().siblings('span').html(datas.resolution_book_name+'<i class="iconfont icon-delete delete_logo"></i>')
                    lxjys = []
                    lxjys.push(datas.resolution_book)
                    lxjys.push(datas.resolution_book_name)
                    lxjys.push(datas.resolution_book_size)
                }
            }
        })

        $.ajax({
            url:'http://jk.com/Admin/Project/projectO',
            type:'post',
            data:{pro_id: pro_id},
            success:function(data){
                if(data.code==1){
                    let datas = data.res
                    let jiansuo = datas.search_result
                    let lunzheng = datas.argu_result
                    let diaoyan = datas.research_result
                    let jiansuoHTML = ''
                    let lunzhengHTML = ''
                    let diaoyanHTML = ''
                    for(let j = 0; j < jiansuo.length; j++){
                        jiansuoHTML += `
                            <li>
                                <ul class="otherList_main" lll="jiansuo">
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索人员：</p>
                                        <p class="other_list_main ">${jiansuo[j].search_user}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索内容：</p>
                                        <p class="other_list_main ">${jiansuo[j].search_content}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索时间：</p>
                                        <p class="other_list_main ">${jiansuo[j].search_time}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索地点：</p>
                                        <p class="other_list_main ">${jiansuo[j].search_addr}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索凭证：</p>
                                        <p class="other_list_main ">${jiansuo[j].search_voucher_name}</p>
                                    </li>
                                    <ul class="otherList_btn">
                                        <li><a href="edit" class="other_title_text_color other_title_text_small" data-id="${jiansuo[j].pro_search_id}"><i class="iconfont icon-bj"></i></a></li>
                                        <li><a href="delete" class="other_title_text_color other_title_text_small" data-id="${jiansuo[j].pro_search_id}"><i class="iconfont icon-105"></i></a></li>
                                    </ul>
                                </ul>
                            </li>
                        `
                    }
                    for(let l = 0; l < lunzheng.length; l++){
                        lunzhengHTML += `
                            <li>
                                <ul class="otherList_main" lll="lunzheng">
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索人员：</p>
                                        <p class="other_list_main ">${lunzheng[l].argu_user}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索内容：</p>
                                        <p class="other_list_main ">${lunzheng[l].argu_content}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">结论：</p>
                                        <p class="other_list_main ">${lunzheng[l].argu_result}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索时间：</p>
                                        <p class="other_list_main ">${lunzheng[l].argu_time}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索地点：</p>
                                        <p class="other_list_main ">${lunzheng[l].argu_addr}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索凭证：</p>
                                        <p class="other_list_main ">${lunzheng[l].argu_file_name}</p>
                                    </li>
                                    <ul class="otherList_btn">
                                        <li><a href="edit" class="other_title_text_color other_title_text_small" data-id="${lunzheng[l].pro_argu_id}"><i class="iconfont icon-bj"></i></a></li>
                                        <li><a href="delete" class="other_title_text_color other_title_text_small" data-id="${lunzheng[l].pro_argu_id}"><i class="iconfont icon-105"></i></a></li>
                                    </ul>
                                </ul>
                            </li>
                        `
                    }
                    for(let d = 0; d < diaoyan.length; d++){
                        diaoyanHTML += `
                            <li>
                                <ul class="otherList_main" lll="diaoyan">
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索人员：</p>
                                        <p class="other_list_main ">${diaoyan[d].research_user}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索内容：</p>
                                        <p class="other_list_main ">${diaoyan[d].research_content}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索时间：</p>
                                        <p class="other_list_main ">${diaoyan[d].research_time}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索地点：</p>
                                        <p class="other_list_main ">${diaoyan[d].research_addr}</p>
                                    </li>
                                    <li class="other_list">
                                        <p class="other_list_title  ">检索凭证：</p>
                                        <p class="other_list_main ">${diaoyan[d].research_report_name}</p>
                                    </li>
                                    <ul class="otherList_btn">
                                        <li><a href="edit" class="other_title_text_color other_title_text_small" data-id="${diaoyan[d].pro_research_id}"><i class="iconfont icon-bj"></i></a></li>
                                        <li><a href="delete" class="other_title_text_color other_title_text_small" data-id="${diaoyan[d].pro_research_id}"><i class="iconfont icon-105"></i></a></li>
                                    </ul>
                                </ul>
                            </li>
                        `
                    }
                    $('#otherList_js_box').html(jiansuoHTML)
                    $('#otherList_lz_box').html(lunzhengHTML)
                    $('#otherList_dy_box').html(diaoyanHTML)
                }
            }
        })
    }

    // 单选按钮
    $('.establishment_info_developType').on('click','li',function(){
        if($(this).children('i').hasClass('icon-Raidobox-selectedRai')){
            $(this).siblings().children('i.icon-Raidobox-selectedRai').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
        }else{
            $(this).children('i').removeClass('icon-Raidobox').addClass('icon-Raidobox-selectedRai')
            $(this).siblings().children('i.icon-Raidobox-selectedRai').removeClass('icon-Raidobox-selectedRai').addClass('icon-Raidobox')
        }
    })
    //项目管理步骤
    $('.establishment_step').on('click','a',function(e){
        e.preventDefault();
        e.stopPropagation();
        var showBOXid = $(this).attr('href')
        $(this).addClass('active').parent().siblings().children('.active').removeClass('active')
        $(showBOXid).addClass('active').siblings('[lll]').removeClass('active')
    })

    // 内容没写完，弹出来的小框框
    // 弹出来的小框框
    function tipShow(){
        $('#yz_modal').addClass('active')
        window.tipBox = setTimeout(function(){
            // $('#yz_modal').removeClass('active')
            // $('#yz_modal').addClass('fadeOut')
            $('#yz_modal').removeClass('active')
            clearTimeout(tipBox)
        },2000)
    }
    // 文本溢出隐藏
    function textLength(){
        $('#technology_area_text').each(function(){
            var maxWidtn = 8;
            if($(this).text().length>maxWidtn){
                $(this).text($(this).text().substring(0,maxWidtn));
                $(this).html($(this).html()+'...')
            }
        })
    }


    /*
    *   基本信息
    * */

    //  资本化、费用化
    $('#expend_box').on('click','li',function(){
        if($(this).children('span').html()=='资本化'){
            $(this).parent().siblings().addClass('active')
            $(this).parent().attr('data-value',1)
        }else{
            $(this).parent().siblings().removeClass('active')
            $(this).parent().attr('data-value',0)
        }
    })
    $('.Distinguish_box>div>i').click(function(){
        $(this).toggleClass('active');
        if($(this).hasClass('active')){
            $(this).parent().siblings('ul').addClass('active')
            $('#switch').attr('data-value',1)
        }else{
            $(this).parent().siblings('ul').removeClass('active')
            $('#switch').attr('data-value',0)
        }
    })
    //研发形式选择并 选择是否显示 委托分类下面的那些其他选项
    $('#typeChoose').on('click','li',function(){
        var showBox = $(this).attr('data-showBox')
        $(this).parent().siblings(`div[lll=${showBox}]`).addClass('active')
        $(this).parent().siblings(`div[lll]:not([lll=${showBox}])`).removeClass('active')
        $('#typeChoose').attr('data-value',showBox)
    })
    $('#typeChoose_box').on('click','.wtyf_choose li',function(){
        var _isShow = $(this).children('span').html()
        // console.log(_isShow)
        if(_isShow=='不含委托研发'){
            // console.log('不含委托研发')
            $(this).parent().siblings('div').removeClass('active')
            $(this).parent().attr('data-value',1)
            console.log($(this).parent().attr('data-value'))
        }else{
            $(this).parent().siblings('div').addClass('active')
            $(this).parent().attr('data-value',0)
            console.log($(this).parent().attr('data-value'))
        }
    })
    $('#typeChoose_box').on('click','.Relation_choose li',function(){
        var _isShow = $(this).children('span').html()
        if(_isShow=='不存在关联关系'){
            $(this).parent().parent().siblings('div[lll=Relation_choose]').removeClass('active')
            $(this).parent().attr('data-value',1)
        }else{
            $(this).parent().parent().siblings('div[lll=Relation_choose]').addClass('active')
            $(this).parent().attr('data-value',0)
        }
    })
    $('#typeChoose_box').on('click','.chooseArea li',function(){
        var _isShow = $(this).children('span').attr('data-value')
        // console.log(_isShow)
        $(this).parent().attr('data-value',_isShow)
    })
    //项目编号旁边的小问号
    $('.xmbh_remark_btn').hover(function(){
        $(this).siblings('.xmbh_remark').children().addClass('active')
    },function(){
        $(this).siblings('.xmbh_remark').children().removeClass('active')
    })
    //技术领域选择
    $('#technology_area').click(function(){
        $(this).siblings().toggleClass('active')
        if($(this).children('i').hasClass('icon-fangxiangxia')){
            $(this).children('i').removeClass('icon-fangxiangxia').addClass('icon-fangxiangshang')
        }else{
            $(this).children('i').removeClass('icon-fangxiangshang').addClass('icon-fangxiangxia')
        }

    })
    $('.js_hidden_box').on('click','>li',function(){
        // 需要发送请求啦
        let tech_id = $(this).attr('data-value')
        let that = this
        $.ajax({
            url:'http://jk.com/Admin/Project/proTechList',
            type:'post',
            data:{
                tech_id: tech_id
            },
            success:function(data){
                if(data.code==1){
                    let datas = data.res
                    let htmls = '<ul>'
                    for(let i = 0; i < datas.length; i++){
                        htmls += `
                            <li class="js_hidden_list" data-value="${datas[i].tech_id}">
                                <span class="establishment_info_14_text">${datas[i].tech_name}</span>
                                <i class="iconfont icon-fangxiangyou js_hidden_list_logo"></i>
                            </li>
                        `
                    }
                    htmls += `
                        </ul>
                    `
                    $('.js_hidden_box').children('.js_hidden_box_zi').html(htmls)
                    $(that).siblings('.js_hidden_box_zi').addClass('active')
                }
            }
        })

        // console.log($(this).attr('data-value'))
    })
    $('.js_hidden_box').on('click','.js_hidden_box_zi>ul>li',function(){
        // console.log($(this).children('span').html())
        let chooseVal = $(this).children('span').html()
        window.sessionStorage['tech_id'] = $(this).attr('data-value')
        $('.js_hidden_box').removeClass('active')
        $('#technology_area_text').html(chooseVal)
        textLength()
    })
    //项目状态——已完成/未完成
    $('#development_progress').on('click','li',function(){
        let _isShow = $(this).children('span').attr('data-value')
        $(this).parent().attr('data-value',_isShow)
    })

     /*
     * 项目立项
     * */
    $('#Application').on('click','.delete_logo',function(e){
        e.stopPropagation();
        e.preventDefault();
        $(this).siblings().remove();
        $(this).remove()
    })

    //input上传的change事件
    $('.hidden_input').on('change',function(e){
        e.stopPropagation();
        let data = this.files;
        let that = this
        for(var i =0;i<data.length;i++){
            let fileReader = new FileReader();
            fileReader.readAsDataURL(data[i]);
            let size = Math.round(data[i].size/1024);
            let name = data[i].name;
            let spanHTML = `<span class="baogao_name">${name}</span><span class="baogao_size">${size}KB</span><i class="iconfont icon-delete delete_logo"></i>`;
            $(this).parent().siblings('span').html(spanHTML)
            let that = this
            fileReader.onload = function (e){
                // console.log( $(this).parent() )
                let url = this.result;
                let inputData = $(that).parent().attr('data-is')
                // console.log(inputData)
                if( inputData=='zz_wtht' ){//自主研发——委托合同
                    zz_wtht.push(url)
                    zz_wtht.push(name)
                    zz_wtht.push(size)
                    // window.sessionStorage['zz_wtht'] = JSON.stringify(zz_wtht)
                }else if( inputData=='zz_mxb' ){//自主研发——明细表
                    zz_mxb.push(url)
                    zz_mxb.push(name)
                    zz_mxb.push(size)
                }else if( inputData=='wt_wtht' ){//委托研发——委托合同
                    wt_wtht.push(url)
                    wt_wtht.push(name)
                    wt_wtht.push(size)
                }else if( inputData=='wt_mxb' ){//委托研发——明细表
                    wt_mxb.push(url)
                    wt_mxb.push(name)
                    wt_mxb.push(size)
                }else if( inputData=='jz_wtht' ){//集中研发——委托合同
                    jz_wtht.push(url)
                    jz_wtht.push(name)
                    jz_wtht.push(size)
                }else if( inputData=='jz_mxb' ){//集中研发——明细表
                    jz_mxb.push(url)
                    jz_mxb.push(name)
                    jz_mxb.push(size)
                }else if( inputData=='hz_wtht' ){//合作研发——委托合同
                    hz_wtht.push(url)
                    hz_wtht.push(name)
                    hz_wtht.push(size)
                }else if( inputData=='hz_mxb' ){//合作研发——明细表
                    hz_mxb.push(url)
                    hz_mxb.push(name)
                    hz_mxb.push(size)
                }else if( inputData=='jf' ){//经费总预算
                    jf.push(url)
                    jf.push(name)
                    jf.push(size)
                }else if( inputData=='bab' ){
                    bab.push(url)
                    bab.push(name)
                    bab.push(size)
                }else if( inputData=='jhrws' ){
                    jhrws.push(url)
                    jhrws.push(name)
                    jhrws.push(size)
                }else if( inputData=='lxjys' ){
                    lxjys.push(url)
                    lxjys.push(name)
                    lxjys.push(size)
                }else if( inputData=='js_add' ){
                    js_add.push(url)
                    js_add.push(name)
                    js_add.push(size)
                }else if( inputData=='js_edit' ){
                    js_edit.push(url)
                    js_edit.push(name)
                    js_edit.push(size)
                }else if( inputData=='lz_add' ){
                    lz_add.push(url)
                    lz_add.push(name)
                    lz_add.push(size)
                }else if( inputData=='lz_edit' ){
                    lz_edit.push(url)
                    lz_edit.push(name)
                    lz_edit.push(size)
                }else if( inputData=='dy_add' ){
                    dy_add.push(url)
                    dy_add.push(name)
                    dy_add.push(size)
                }else if( inputData=='dy_edit' ){
                    dy_edit.push(url)
                    dy_edit.push(name)
                    dy_edit.push(size)
                }
            }
        }
    })

    // 当删除合同文件的时候
    $('.Application_baogao').children('span').on('click','i',function(e){
        let data_is = $(this).parent().siblings().attr('data-is')
        if( data_is == 'zz_wtht' ){
            zz_wtht = []
        }else if( data_is == 'zz_mxb' ){
            zz_mxb = []
        }else if( data_is == 'wt_wtht' ){
            wt_wtht = []
        }else if( data_is == 'wt_mxb' ){
            wt_mxb = []
        }else if( data_is == 'jz_wtht' ){
            jz_wtht = []
        }else if( data_is == 'jz_mxb' ){
            jz_mxb = []
        }else if( data_is == 'hz_wtht' ){
            hz_wtht = []
        }else if( data_is == 'hz_mxb' ){
            hz_mxb = []
        }else if( data_is == 'jf' ){
            jf = []
        }else if( data_is == 'bab' ){
            bab = []
        }else if( data_is == 'jhrws' ){
            jhrws = []
        }else if( data_is == 'lxjys' ){
            lxjys = []
        }else if( data_is == 'js_add' ){
            js_add = []
        }else if( data_is == 'js_edit' ){
            js_edit = []
        }else if( data_is == 'lz_add' ){
            lz_add = []
        }else if( data_is == 'lz_edit' ){
            lz_edit = []
        }else if( data_is == 'dy_add' ){
            dy_add = []
        }else if( data_is == 'dy_edit' ){
            dy_edit = []
        }

        $(this).parent().siblings().children('input').val('')
        // console.log($(this).parent().siblings().children('input'))
        $(this).parent().children().remove()
    })

    /*
    * 项目管理-其他
    * */
    $('.otherList_box').on('click','.other_add_btn',function(){
        $(this).parent().siblings('[yyy=addBOX]').addClass('active')
    })
    $('.other_list_box').on('click','.otherList_btn>li>a',function(e){
        e.preventDefault()
        let pro_data_id = $(this).attr('data-id')
        // let pro_id = window.sessionStorage['pro_id']
        let data_type = $(this).closest('[lll]').attr('lll')
        let that = this
        let type
        if(data_type=='jiansuo'){
            type = 0
        }else if(data_type=='lunzheng'){
            type = 1
        }else if(data_type=='diaoyan'){
            type = 2
        }
        if( $(this).attr('href') == 'edit' ){
            if(type == 0){
                $.ajax({
                    url:'http://jk.com/Admin/Project/projectOS',
                    type:'post',
                    data:{
                        pro_search_id:pro_data_id,
                        pro_id:pro_id
                    },
                    success:function(data){
                        if(data.code==1){
                            let edit_box = $(that).closest('.other_list_box').siblings('[yyy=editBOX]')
                            let datas = data.res
                            $(edit_box).find('[add_name="jiansuo_people"]').val(datas.search_user)
                            $(edit_box).find('[add_name="jiansuo_content"]').val(datas.search_content)
                            $(edit_box).find('[add_name="jiansuo_time2"]').val(datas.search_time)
                            $(edit_box).find('[add_name="jiansuo_pro"]').val(datas.search_addr_province)
                            $(edit_box).find('[add_name="jiansuo_city"]').val(datas.search_addr_city)
                            $(edit_box).find('[add_name="jiansuo_zone"]').val(datas.search_addr_county)
                            $(edit_box).find('[add_name="jiansuo_file"]').parent().siblings('span').html(datas.search_voucher_name+'<i class="iconfont icon-delete delete_logo"></i>')
                            js_edit = []
                            js_edit.push(datas.search_voucher)
                            js_edit.push(datas.search_voucher_name)
                            js_edit.push(datas.search_voucher_size)
                        }
                    }
                })
            }else if( type == 1 ){
                $.ajax({
                    url:'http://jk.com/Admin/Project/projectOA',
                    type:'post',
                    data:{
                        pro_argu_id:pro_data_id,
                        pro_id:pro_id
                    },
                    success:function(data){
                        if(data.code==1){
                            let edit_box = $(that).closest('.other_list_box').siblings('[yyy=editBOX]')
                            let datas = data.res
                            $(edit_box).find('[add_name="lunzheng_people"]').val(datas.argu_user)
                            $(edit_box).find('[add_name="lunzheng_content"]').val(datas.argu_content)
                            $(edit_box).find('[add_name="lunzheng_conclusion"]').val(datas.argu_result)
                            $(edit_box).find('[add_name="lunzheng_time2"]').val(datas.argu_time)
                            $(edit_box).find('[add_name="lunzheng_pro"]').val(datas.argu_addr_province)
                            $(edit_box).find('[add_name="lunzheng_city"]').val(datas.argu_addr_city)
                            $(edit_box).find('[add_name="lunzheng_zone"]').val(datas.argu_addr_county)
                            $(edit_box).find('[add_name="lunzheng_file"]').parent().siblings('span').html(datas.argu_file_name+'<i class="iconfont icon-delete delete_logo"></i>')
                            lz_edit = []
                            lz_edit.push(datas.argu_file)
                            lz_edit.push(datas.argu_file_name)
                            lz_edit.push(datas.argu_file_size)
                        }
                    }
                })
            }else if( type == 2 ){
                $.ajax({
                    url:'http://jk.com/Admin/Project/projectOR',
                    type:'post',
                    data:{
                        pro_research_id:pro_data_id,
                        pro_id:pro_id
                    },
                    success:function(data){
                        if(data.code==1){
                            let edit_box = $(that).closest('.other_list_box').siblings('[yyy=editBOX]')
                            let datas = data.res
                            $(edit_box).find('[add_name="diaoyan_people"]').val(datas.research_user)
                            $(edit_box).find('[add_name="diaoyan_content"]').val(datas.research_content)
                            $(edit_box).find('[add_name="diaoyan_time2"]').val(datas.research_time)
                            $(edit_box).find('[add_name="diaoyan_pro"]').val(datas.research_addr_province)
                            $(edit_box).find('[add_name="diaoyan_city"]').val(datas.research_addr_city)
                            $(edit_box).find('[add_name="diaoyan_zone"]').val(datas.research_addr_county)
                            $(edit_box).find('[add_name="diaoyan_file"]').parent().siblings('span').html(datas.research_report_name+'<i class="iconfont icon-delete delete_logo"></i>')
                            dy_edit = []
                            dy_edit.push(datas.research_report)
                            dy_edit.push(datas.research_report_name)
                            dy_edit.push(datas.research_report_size)
                        }
                    }
                })
            }
            $(this).closest('.other_list_box').siblings('[yyy=editBOX]').addClass('active')
        }else if( $(this).attr('href') == 'delete' ){
            $.ajax({
                url:'http://jk.com/Admin/Project/deleteOtherInf',
                type:'post',
                data:{
                    type:type,
                    oid:pro_data_id,
                    pro_id:pro_id
                },
                success:function(data){
                    if(data.code==1){
                        $(that).parent().parent().parent().parent().remove()
                    }
                }
            })
        }
    })
    $('#other').on('click','.inputBox',function(){
        $(this).children('.hidden_list').toggleClass('active')
    })
    // 地点选择
    $('.hidden_list').on('click','li',function(){
        var pro = $(this).html()
        $(this).parent().siblings('input').val(pro)
    })
    $('.provinces').children('ul').on('click','li',function(e){
        let provinceid = $(this).attr('data-id')
        let that = this
        $.ajax({
            url:'http://jk.com/Admin/Project/citiesList',
            type:'get',
            data:{
                provinceid: provinceid
            },
            success:function(data){
                if(data.code==1){
                    let datas = data.res
                    let htmls = ''
                    for(let i = 0; i < datas.length; i++){
                        htmls += `<li data-id="${datas[i].cityid}">${datas[i].city}</li>`
                    }
                    $(that).parent().parent().siblings('.city').children('ul').html(htmls)
                }
            }
        })
    })
    $('.city').children('ul').on('click','li',function(e){
        let cityid = $(this).attr('data-id')
        let that = this
        $.ajax({
            url:'http://jk.com/Admin/Project/areasList',
            type:'get',
            data:{
                cityid: cityid
            },
            success:function(data){
                if(data.code==1){
                    let datas = data.res
                    let htmls = ''
                    for(let i = 0; i < datas.length; i++){
                        htmls += `<li data-id="${datas[i].areaid}">${datas[i].area}</li>`
                    }
                    $(that).parent().parent().siblings('.area').children('ul').html(htmls)
                }
            }
        })
    })
    // 检索
    $('#jiansuo').on('click','.hidden_box_btn button',function(){
        if($(this).html()==='确认'){
            let jiansuo_people = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_people]').val()
            let jiansuo_content = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_content]').val()
            let jiansuo_time = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_time]').val()
            // var jiansuo_time = window.jiansuo_time
            let jiansuo_pro = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_pro]').val()
            let jiansuo_city = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_city]').val()
            let jiansuo_zone = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_zone]').val()
            let jiansuo_file = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_file]').val()

            if(jiansuo_people=='' || jiansuo_content=='' || jiansuo_time=='' || jiansuo_pro=='' || jiansuo_city=='' || jiansuo_zone=='' || jiansuo_file==''){
                $('#yz_modal').addClass('active')
                tipShow()
                return
            }

            let that = this
            $.ajax({
                url:'http://jk.com/Admin/Project/otherInf',
                type:'post',
                data:{
                    type: 0,
                    pro_id: pro_id,
                    search_user: jiansuo_people,
                    search_content: jiansuo_content,
                    search_time: jiansuo_time,
                    addr_pro: jiansuo_pro,
                    addr_city: jiansuo_city,
                    addr_county: jiansuo_zone,
                    search_voucher: js_add
                },
                success:function(data){
                    if(data.code==1){
                        var lastIndex =  jiansuo_file.lastIndexOf("\\")
                        var jiansuo_fileVal = jiansuo_file.substring(lastIndex+1)

                        var otherList_js_boxHTML = $('#otherList_js_box').html()
                        otherList_js_boxHTML += `
                   <li>
                        <ul class="otherList_main" lll="jiansuo">
                            <li class="other_list">
                                <p class="other_list_title  ">检索人员：</p>
                                <p class="other_list_main ">${jiansuo_people}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">检索人员：</p>
                                <p class="other_list_main ">${jiansuo_content}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">检索时间：</p>
                                <p class="other_list_main ">${jiansuo_time}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">检索地点：</p>
                                <p class="other_list_main ">${jiansuo_pro}省${jiansuo_pro}市${jiansuo_zone}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">检索凭证：</p>
                                <p class="other_list_main ">${jiansuo_fileVal}</p>
                            </li>
                            <ul class="otherList_btn">
                                <li><a href="edit" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_search_id}"><i class="iconfont icon-bj"></i></a></li>
                                <li><a href="delete" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_search_id}"><i class="iconfont icon-105"></i></a></li>
                            </ul>
                        </ul>
                    </li>
            `
                        $('#otherList_js_box').html(otherList_js_boxHTML)
                        $(that).closest('[lll]').find('[add_name]').val('')
                        $(that).closest('[lll]').find('[add_name="jiansuo_file"]').parent().siblings('span').children().remove()
                        $(that).closest('[lll]').removeClass('active')
                        js_add = []
                    }else{
                        $('#yz_modal').html(data.msg)
                        $('#yz_modal').addClass('active')
                        tipShow()
                        return
                    }
                }
            })


        }
        if($(this).html()==='确认并新增'){
            let jiansuo_people = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_people]').val()
            let jiansuo_content = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_content]').val()
            let jiansuo_time = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_time]').val()
            // var jiansuo_time = window.jiansuo_time
            let jiansuo_pro = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_pro]').val()
            let jiansuo_city = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_city]').val()
            let jiansuo_zone = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_zone]').val()
            let jiansuo_file = $(this).closest('[yyy=addBOX]').find('[add_name=jiansuo_file]').val()

            if(jiansuo_people=='' || jiansuo_content=='' || jiansuo_time=='' || jiansuo_pro=='' || jiansuo_city=='' || jiansuo_zone=='' || jiansuo_file==''){
                $('#yz_modal').addClass('active')
                tipShow()
                return
            }

            let that = this
            $.ajax({
                url:'http://jk.com/Admin/Project/otherInf',
                type:'post',
                data:{
                    type: 0,
                    pro_id: pro_id,
                    search_user: jiansuo_people,
                    search_content: jiansuo_content,
                    search_time: jiansuo_time,
                    addr_pro: jiansuo_pro,
                    addr_city: jiansuo_city,
                    addr_county: jiansuo_zone,
                    search_voucher: js_add
                },
                success:function(data){
                    if(data.code==1){
                        var lastIndex =  jiansuo_file.lastIndexOf("\\")
                        var jiansuo_fileVal = jiansuo_file.substring(lastIndex+1)

                        var otherList_js_boxHTML = $('#otherList_js_box').html()
                        otherList_js_boxHTML += `
                   <li>
                        <ul class="otherList_main" lll="jiansuo">
                            <li class="other_list">
                                <p class="other_list_title  ">检索人员：</p>
                                <p class="other_list_main ">${jiansuo_people}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">检索人员：</p>
                                <p class="other_list_main ">${jiansuo_content}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">检索时间：</p>
                                <p class="other_list_main ">${jiansuo_time}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">检索地点：</p>
                                <p class="other_list_main ">${jiansuo_pro}省${jiansuo_pro}市${jiansuo_zone}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">检索凭证：</p>
                                <p class="other_list_main ">${jiansuo_fileVal}</p>
                            </li>
                            <ul class="otherList_btn">
                                <li><a href="#" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_search_id}"><i class="iconfont icon-bj"></i></a></li>
                                <li><a href="#" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_search_id}"><i class="iconfont icon-105"></i></a></li>
                            </ul>
                        </ul>
                    </li>
            `
                        $('#otherList_js_box').html(otherList_js_boxHTML)
                        $(that).closest('[lll]').find('[add_name]').val('')
                        $(that).closest('[lll]').find('[add_name="jiansuo_file"]').parent().siblings('span').children().remove()
                        // $(that).closest('[lll]').removeClass('active')
                        js_add = []
                    }else{
                        $('#yz_modal').html(data.msg)
                        $('#yz_modal').addClass('active')
                        tipShow()
                        return
                    }
                }
            })
        }
        if($(this).html()==='取消'){
            $(this).closest('[lll]').removeClass('active')
        }
    })
    // 论证
    $('#lunzheng').on('click','.hidden_box_btn button',function(){
        if($(this).html()==='确认'){
            let lunzheng_people = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_people]').val()
            let lunzheng_content = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_content]').val()
            let lunzheng_conclusion = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_conclusion]').val()
            let lunzheng_time = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_time]').val()
            let lunzheng_pro = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_pro]').val()
            let lunzheng_city = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_city]').val()
            let lunzheng_zone = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_zone]').val()
            let lunzheng_file = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_file]').val()

            if(lunzheng_people=='' || lunzheng_content=='' || lunzheng_conclusion=='' || lunzheng_time=='' || lunzheng_pro=='' || lunzheng_city=='' || lunzheng_zone=='' || lunzheng_file==''){
                $('#yz_modal').addClass('active')
                tipShow()
                return
            }
            let that = this
            $.ajax({
                url:'http://jk.com/Admin/Project/otherInf',
                type:'post',
                data:{
                    type: 1,
                    pro_id: pro_id,
                    argu_user: lunzheng_people,
                    argu_content: lunzheng_content,
                    argu_result: lunzheng_conclusion,
                    argu_time: lunzheng_time,
                    addr_pro: lunzheng_pro,
                    addr_city: lunzheng_city,
                    addr_county: lunzheng_zone,
                    argu_file: lz_add
                },
                success:function(data){
                    if(data.code==1){
                        var lastIndex =  lunzheng_file.lastIndexOf("\\")
                        var lunzheng_fileVal = lunzheng_file.substring(lastIndex+1)

                        var otherList_lz_boxHTML = $('#otherList_lz_box').html()
                        otherList_lz_boxHTML += `
                   <li>
                        <ul class="otherList_main" lll="lunzheng">
                            <li class=" other_list">
                                <p class="other_list_title  ">论证专家：</p>
                                <p class="other_list_main ">${lunzheng_people}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">论证内容：</p>
                                <p class="other_list_main ">${lunzheng_content}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">立项结论：</p>
                                <p class="other_list_main ">${lunzheng_conclusion}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">论证时间：</p>
                                <p class="other_list_main ">${lunzheng_time}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">论证地点：</p>
                                <p class="other_list_main ">${lunzheng_pro}省${lunzheng_city}市${lunzheng_zone}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">立项文件：</p>
                                <p class="other_list_main ">${lunzheng_fileVal}</p>
                            </li>
                            <ul class="otherList_btn">
                                <li><a href="edit" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_argu_id}"><i class="iconfont icon-bj"></i></a></li>
                                <li><a href="delete" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_argu_id}"><i class="iconfont icon-105"></i></a></li>
                            </ul>
                        </ul>
                    </li>
            `
                        $('#otherList_lz_box').html(otherList_lz_boxHTML)
                        $(that).closest('[lll]').find('[add_name]').val('')
                        $(that).closest('[lll]').find('[add_name="lunzheng_file"]').parent().siblings('span').children().remove()
                        $(that).closest('[lll]').removeClass('active')
                    }else{
                        $('#yz_modal').html(data.msg)
                        $('#yz_modal').addClass('active')
                        tipShow()
                        return
                    }
                }
            })


        }
        if($(this).html()==='确认并新增'){
            let lunzheng_people = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_people]').val()
            let lunzheng_content = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_content]').val()
            let lunzheng_conclusion = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_conclusion]').val()
            let lunzheng_time = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_time]').val()
            let lunzheng_pro = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_pro]').val()
            let lunzheng_city = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_city]').val()
            let lunzheng_zone = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_zone]').val()
            let lunzheng_file = $(this).closest('[yyy=addBOX]').find('[add_name=lunzheng_file]').val()

            if(lunzheng_people=='' || lunzheng_content=='' || lunzheng_conclusion=='' || lunzheng_time=='' || lunzheng_pro=='' || lunzheng_city=='' || lunzheng_zone=='' || lunzheng_file==''){
                $('#yz_modal').addClass('active')
                tipShow()
                return
            }
            let that = this
            $.ajax({
                url:'http://jk.com/Admin/Project/otherInf',
                type:'post',
                data:{
                    type: 1,
                    pro_id: pro_id,
                    argu_user: lunzheng_people,
                    argu_content: lunzheng_content,
                    argu_result: lunzheng_conclusion,
                    argu_time: lunzheng_time,
                    addr_pro: lunzheng_pro,
                    addr_city: lunzheng_city,
                    addr_county: lunzheng_zone,
                    argu_file: lz_add
                },
                success:function(data){
                    if(data.code==1){
                        var lastIndex =  lunzheng_file.lastIndexOf("\\")
                        var lunzheng_fileVal = lunzheng_file.substring(lastIndex+1)

                        var otherList_lz_boxHTML = $('#otherList_lz_box').html()
                        otherList_lz_boxHTML += `
                   <li>
                        <ul class="otherList_main" lll="lunzheng">
                            <li class=" other_list">
                                <p class="other_list_title  ">论证专家：</p>
                                <p class="other_list_main ">${lunzheng_people}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">论证内容：</p>
                                <p class="other_list_main ">${lunzheng_content}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">立项结论：</p>
                                <p class="other_list_main ">${lunzheng_conclusion}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">论证时间：</p>
                                <p class="other_list_main ">${lunzheng_time}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">论证地点：</p>
                                <p class="other_list_main ">${lunzheng_pro}省${lunzheng_city}市${lunzheng_zone}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">立项文件：</p>
                                <p class="other_list_main ">${lunzheng_fileVal}</p>
                            </li>
                            <ul class="otherList_btn">
                                <li><a href="edit" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_argu_id}"><i class="iconfont icon-bj"></i></a></li>
                                <li><a href="delete" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_argu_id}"><i class="iconfont icon-105"></i></a></li>
                            </ul>
                        </ul>
                    </li>
            `
                        $('#otherList_lz_box').html(otherList_lz_boxHTML)
                        $(that).closest('[lll]').find('[add_name]').val('')
                        $(that).closest('[lll]').find('[add_name="lunzheng_file"]').parent().siblings('span').children().remove()
                        // $(that).closest('[lll]').removeClass('active')
                    }else{
                        $('#yz_modal').html(data.msg)
                        $('#yz_modal').addClass('active')
                        tipShow()
                        return
                    }
                }
            })
        }
        if($(this).html()==='取消'){
            $(this).closest('[lll]').removeClass('active')
        }
    })
    // 调研
    $('#diaoyan').on('click','.hidden_box_btn button',function(){
        if($(this).html()==='确认'){
            let diaoyan_people = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_people]').val()
            let diaoyan_content = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_content]').val()
            let diaoyan_time = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_time]').val()
            let diaoyan_pro = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_pro]').val()
            let diaoyan_city = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_city]').val()
            let diaoyan_zone = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_zone]').val()
            let diaoyan_file = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_file]').val()

            if(diaoyan_people=='' || diaoyan_content=='' || diaoyan_time=='' || diaoyan_pro=='' || diaoyan_city=='' || diaoyan_zone=='' || diaoyan_file==''){
                $('#yz_modal').addClass('active')
                tipShow()
                return
            }
            let that = this
            $.ajax({
                url:'http://jk.com/Admin/Project/otherInf',
                type:'post',
                data:{
                    type: 2,
                    pro_id: pro_id,
                    research_user: diaoyan_people,
                    research_content: diaoyan_content,
                    research_time: diaoyan_time,
                    addr_pro: diaoyan_pro,
                    addr_city: diaoyan_city,
                    addr_county: diaoyan_zone,
                    research_report: dy_add
                },
                success:function(data){
                    if(data.code==1){
                        var lastIndex =  diaoyan_file.lastIndexOf("\\")
                        var diaoyan_fileVal = diaoyan_file.substring(lastIndex+1)

                        var otherList_dy_boxHTML = $('#otherList_dy_box').html()
                        otherList_dy_boxHTML += `
                   <li>
                        <ul class="otherList_main" lll="diaoyan">
                            <li class=" other_list">
                                <p class="other_list_title  ">调研人员：</p>
                                <p class="other_list_main ">${diaoyan_people}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">调研内容：</p>
                                <p class="other_list_main ">${diaoyan_content}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">调研时间：</p>
                                <p class="other_list_main ">${diaoyan_time}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">论证地点：</p>
                                <p class="other_list_main ">${diaoyan_pro}省${diaoyan_city}市${diaoyan_zone}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">立项文件：</p>
                                <p class="other_list_main ">${diaoyan_fileVal}</p>
                            </li>
                            <ul class="otherList_btn">
                                <li><a href="edit" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_research_id}"><i class="iconfont icon-bj"></i></a></li>
                                <li><a href="delete" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_research_id}"><i class="iconfont icon-105"></i></a></li>
                            </ul>
                        </ul>
                    </li>
            `
                        $('#otherList_dy_box').html(otherList_dy_boxHTML)
                        $(that).closest('[lll]').find('[add_name]').val('')
                        $(that).closest('[lll]').find('[add_name="diaoyan_file"]').parent().siblings('span').children().remove()
                        $(that).closest('[lll]').removeClass('active')
                    }else{
                        $('#yz_modal').html(data.msg)
                        $('#yz_modal').addClass('active')
                        tipShow()
                        return
                    }
                }
            })


        }
        if($(this).html()==='确认并新增'){
            let diaoyan_people = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_people]').val()
            let diaoyan_content = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_content]').val()
            let diaoyan_time = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_time]').val()
            let diaoyan_pro = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_pro]').val()
            let diaoyan_city = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_city]').val()
            let diaoyan_zone = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_zone]').val()
            let diaoyan_file = $(this).closest('[yyy=addBOX]').find('[add_name=diaoyan_file]').val()

            if(diaoyan_people=='' || diaoyan_content=='' || diaoyan_time=='' || diaoyan_pro=='' || diaoyan_city=='' || diaoyan_zone=='' || diaoyan_file==''){
                $('#yz_modal').addClass('active')
                tipShow()
                return
            }
            let that = this
            $.ajax({
                url:'http://jk.com/Admin/Project/otherInf',
                type:'post',
                data:{
                    type: 2,
                    pro_id: pro_id,
                    research_user: diaoyan_people,
                    research_content: diaoyan_content,
                    research_time: diaoyan_time,
                    addr_pro: diaoyan_pro,
                    addr_city: diaoyan_city,
                    addr_county: diaoyan_zone,
                    research_report: dy_add
                },
                success:function(data){
                    if(data.code==1){
                        var lastIndex =  diaoyan_file.lastIndexOf("\\")
                        var diaoyan_fileVal = diaoyan_file.substring(lastIndex+1)

                        var otherList_dy_boxHTML = $('#otherList_dy_box').html()
                        otherList_dy_boxHTML += `
                   <li>
                        <ul class="otherList_main" lll="diaoyan">
                            <li class=" other_list">
                                <p class="other_list_title  ">调研人员：</p>
                                <p class="other_list_main ">${diaoyan_people}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">调研内容：</p>
                                <p class="other_list_main ">${diaoyan_content}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">调研时间：</p>
                                <p class="other_list_main ">${diaoyan_time}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">论证地点：</p>
                                <p class="other_list_main ">${diaoyan_pro}省${diaoyan_city}市${diaoyan_zone}</p>
                            </li>
                            <li class="other_list">
                                <p class="other_list_title  ">立项文件：</p>
                                <p class="other_list_main ">${diaoyan_fileVal}</p>
                            </li>
                            <ul class="otherList_btn">
                                <li><a href="edit" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_research_id}"><i class="iconfont icon-bj"></i></a></li>
                                <li><a href="delete" class="other_title_text_color other_title_text_small" data-id="${data.res.pro_research_id}"><i class="iconfont icon-105"></i></a></li>
                            </ul>
                        </ul>
                    </li>
            `
                        $('#otherList_dy_box').html(otherList_dy_boxHTML)
                        $(that).closest('[lll]').find('[add_name]').val('')
                        $(that).closest('[lll]').find('[add_name="diaoyan_file"]').parent().siblings('span').children().remove()
                        // $(that).closest('[lll]').removeClass('active')
                    }else{
                        $('#yz_modal').html(data.msg)
                        $('#yz_modal').addClass('active')
                        tipShow()
                        return
                    }
                }
            })
        }
        if($(this).html()==='取消'){
            $(this).closest('[lll]').removeClass('active')
        }
    })

    /*
    * 立项完成
    * */
    $('.success_list_box').on('click','li',function(){
        var showBox = $(this).attr('lll')
        $(`[lll=${showBox}]`).addClass('active')
        $(`[lll=${showBox}]`).siblings().removeClass('active')

        $('.establishment_step').children().children(`[href=#${showBox}]`).addClass('active')
        $('.establishment_step').children().children(`[href=#${showBox}]`).parent().siblings().children('.active').removeClass('active')
    })

    //当 基本信息 确认按钮点击时  去死吧！！！！！！！
    $('.basic_info_btn').click(function(e){
        e.preventDefault()
        //判断项目编号是否填写 project_num
        if($('#project_num').val()){
           var  project_num = $('#project_num').val()
        }else{
            tipShow()
            return
        }
        //判断项目名称是否填写 project_name
        if($('#project_name').val()){
            var  project_name = $('#project_name').val()
        }else{
            tipShow()
            return
        }
        //判断费用化资本化
        let expend_opt = []
        let expend = $('#expend_box').attr('data-value')
        expend_opt.push(expend)
        if(expend == 1){//当资本化时
            if($('#switch').attr('data-value') == 1){//打开按钮时
                let _switch = $('#switch').attr('data-value')
                expend_opt.push(_switch)
                if($('#Research_startTime').val() && $('#Research_endTime').val() && $('#Development_startTime').val() && $('#Development_endTime').val()){//当时间都填上时
                    // var Research_startTime = $('#Research_startTime').val()
                    // var Research_endTime = $('#Research_endTime').val()
                    // var Development_startTime = $('#Development_startTime').val()
                    // var Development_endTime = $('#Development_endTime').val()
                    expend_opt.push($('#Research_startTime').val())
                    expend_opt.push($('#Research_endTime').val())
                    expend_opt.push($('#Development_startTime').val())
                    expend_opt.push($('#Development_endTime').val())
                }else{
                    tipShow()
                    return
                }
            }
        }
        //判断研发形式
        let re_form = []
        let typeChoose = $('#typeChoose').attr('data-value')
        re_form.push(typeChoose)
        // console.log(jz_mxb)
        // console.log(jz_wtht)
        if( typeChoose == 0 ){//自主研发时
            let zz_chooseWT = $('#zz_chooseWT').attr('data-value')
            re_form.push(zz_chooseWT)
            if(zz_chooseWT == 0){//含委托研发时
                let zz_chooseArea = $('#zz_chooseArea').attr('data-value')
                let zz_WTcompany = $('#zz_WTcompany').val()
                // let zz_WTcontract = $('#zz_WTcontract').val()
                re_form.push(zz_chooseArea)
                re_form.push(zz_WTcompany)

                re_form.push(zz_wtht)

                if(!zz_WTcompany || zz_wtht.length<=0){
                    tipShow()
                    return
                }
                let zz_Relation_choose = $('#zz_Relation_choose').attr('data-value')
                re_form.push(zz_Relation_choose)
                if(zz_Relation_choose == 0){//存在关联时
                    let zz_Relation = $('#zz_Relation').val()
                    // re_form.push(zz_Relation)

                    re_form.push(zz_mxb)

                    if(zz_mxb.length<=0){
                        tipShow()
                        return
                    }
                }
            }
        }
        if( typeChoose == 1 ){//委托研发时
            let wt_chooseArea = $('#wt_chooseArea').attr('data-value')
            let wt_WTcompany = $('#wt_WTcompany').val()
            // let wt_WTcontract = $('#wt_WTcontract').val()
            re_form.push(wt_chooseArea)
            re_form.push(wt_WTcompany)

            re_form.push(wt_wtht)

            if(!wt_WTcompany || wt_wtht.length<=0){
                tipShow()
                return
            }
            let wt_Relation_choose = $('#wt_Relation_choose').attr('data-value')
            re_form.push(wt_Relation_choose)
            if(wt_Relation_choose == 0){//存在关联关系时
                // let wt_Relation = $('#wt_Relation').val()
                // re_form.push(wt_Relation)

                re_form.push(wt_mxb)

                if(wt_mxb.length<=0){
                    tipShow()
                    return
                }
            }
        }
        if( typeChoose == 2 ){//集中研发时
            let jz_chooseWT = $('#jz_chooseWT').attr('data-value')
            re_form.push(jz_chooseWT)
            if(jz_chooseWT == 0){//含委托研发
                let jz_chooseArea = $('#jz_chooseArea').attr('data-value')
                let jz_WTcompany = $('#jz_WTcompany').val()
                // let jz_WTcontract = $('#jz_WTcontract').val()
                let jz_group = $('#jz_group').val()
                re_form.push(jz_chooseArea)
                re_form.push(jz_WTcompany)

                re_form.push(jz_wtht)
                if(!jz_WTcompany || jz_wtht.length<=0 || !jz_group){
                    tipShow()
                    return
                }
                let jz_Relation_choose = $('#jz_Relation_choose').attr('data-value')
                re_form.push(jz_Relation_choose)
                re_form.push(jz_group)
                if(jz_Relation_choose == 0){//存在关联关系
                    // let jz_Relation = $('#jz_Relation').val()

                    re_form.push(jz_mxb)

                    if(jz_mxb.length<=0){
                        tipShow()
                        return
                    }
                }
            }
        }
        if( typeChoose == 3 ){//合作研发
            let hz_chooseWT = $('#hz_chooseWT').attr('data-value')
            re_form.push(hz_chooseWT)
            if(hz_chooseWT == 0){//含委托研发
                let hz_chooseArea = $('#hz_chooseArea').attr('data-value')
                let hz_WTcompany = $('#hz_WTcompany').val()
                // let hz_WTcontract = $('#hz_WTcontract').val()
                let hz_cooperation = $('#hz_cooperation').val()
                re_form.push(hz_chooseArea)
                re_form.push(hz_WTcompany)

                re_form.push(hz_wtht)

                if(!hz_WTcompany || hz_wtht.length<=0 || !hz_cooperation){
                    tipShow()
                    return
                }
                let hz_Relation_choose = $('#hz_Relation_choose').attr('data-value')
                re_form.push(hz_Relation_choose)
                re_form.push(hz_cooperation)

                if(hz_Relation_choose == 0){//存在关联关系
                    // let hz_Relation = $('#hz_Relation').val()
                    // re_form.push(hz_Relation)
                    re_form.push(hz_mxb)

                    if(hz_mxb.length<=0){
                        tipShow()
                        return
                    }
                }
            }
        }
        //判断技术领域
        if($('#technology_area_text').html()==''){
            tipShow()
            return
        }else{
            // let technology_area_text = $('#technology_area_text').html()
        }
        //判断经费总预算
        let Monty_ALLbudget = $('#Monty_ALLbudget').val()
        // let Monty_ALLbudget_file = $('#Monty_ALLbudget_file').val()
        if(!Monty_ALLbudget || jf.length<=0){
            tipShow()
            return
        }
        //项目状态
        let development_progress = $('#development_progress').attr('data-value')
        //研发机构
        let development_mechanism = $('#development_mechanism').val()
        //主要内容
        let mainContent = $('#mainContent').val()


        let tech_id = window.sessionStorage['tech_id']//技术领域
        let pro_total_file = jf

        // console.log(project_num)
        // console.log(project_name)
        // console.log(expend_opt)
        // console.log(re_form)
        // console.log(tech_id)
        // console.log(Monty_ALLbudget)
        // console.log(pro_total_file)
        // console.log(development_progress)
        // console.log(development_mechanism)
        // console.log(mainContent)
        console.log(pro_id)
        console.log(window.sessionStorage['pro_id'])
        let that = this
        $.ajax({
            url:'http://jk.com/Admin/Project/projectAOM',
            type:'post',
            data:{
                pro_id: pro_id,
                pro_sn: project_num,
                pro_name: project_name,
                expend_opt: expend_opt,
                re_form: re_form,
                tech_id: tech_id,
                pro_total: Monty_ALLbudget,
                pro_total_file: pro_total_file,
                pro_status: development_progress,
                pro_jigou: development_mechanism,
                pro_content: mainContent
            },
            success:function(data){
                // console.log(data)
                if( data.code == 1 ){

                    pro_id = data.res.pro_id
                    // window.sessionStorage['pro_id'] = pro_id
                    var toBox = $(that).find('a').attr('href')
                    $('#main').children(`div[lll]:not(div[lll=${toBox}])`).removeClass('active')
                    $(toBox).addClass('active')
                    $('.establishment_step').find(`a[href=${toBox}]`).addClass('active')
                    $('.establishment_step').find(`a:not([href=${toBox}])`).removeClass('active')
                }else{
                    $('#yz_modal').html(data.msg)
                    $('#yz_modal').addClass('active')
                    tipShow()
                    return
                }
            }
        })



        // var toBox = $(this).find('a').attr('href')
        // $('#main').children(`div[lll]:not(div[lll=${toBox}])`).removeClass('active')
        // $(toBox).addClass('active')
        // $('.establishment_step').find(`a[href=${toBox}]`).addClass('active')
        // $('.establishment_step').find(`a:not([href=${toBox}])`).removeClass('active')
    })
    //当 立项决议确认按钮点击时
    $('.ApplicationBOX_btn').click(function(e){
        e.preventDefault()
        let Application_people = $('#Application_people').val()
        let Application_time = $('#Application_time').val()
        let conduct_startTime = $('#conduct_startTime').val()
        let conduct_endTime = $('#conduct_endTime').val()
        // let Application_baogao = $('#Application_baogao').val()
        // let Application_Prospectus = $('#Application_Prospectus').val()
        // let Application_Resolution = $('#Application_Resolution').val()
        if(!Application_people || !Application_time || !conduct_startTime || !conduct_endTime || bab.length<=0 || jhrws.length<=0 || lxjys.length<=0 ){
            tipShow()
            return
        }
        let that = this
        $.ajax({
            url:'http://jk.com/Admin/Project/applyProj',
            type:'post',
            data:{
                pro_id: pro_id,
                apply_user: Application_people,
                apply_time: Application_time,
                pro_start: conduct_startTime,
                pro_end: conduct_endTime,
                apply_plan: bab,
                tax_reduce_recorder: jhrws,
                resolution_book: lxjys
            },
            success:function(data){
                console.log(data)
                if(data.code==1){
                    // let pro_id = data.res.pro_id
                    // window.sessionStorage['pro_id'] = pro_id

                    var toBox = $(that).attr('href')
                    $('#main').children(`div[lll]:not(div[lll=${toBox}])`).removeClass('active')
                    $(toBox).addClass('active')
                    $('.establishment_step').find(`a[href=${toBox}]`).addClass('active')
                    $('.establishment_step').find(`a:not([href=${toBox}])`).removeClass('active')

                    $.ajax({
                        url:'http://jk.com/Admin/Project/provincesList',
                        type:'get',
                        success:function(data){
                            let datas = data.res
                            let htmls = ''
                            for(let i=0;i<datas.length;i++){
                                htmls += `<li data-id="${datas[i].provinceid}">${datas[i].province}</li>`
                            }
                            $('.provinces').children('ul.hidden_list').html(htmls)
                        }
                    })
                }
            }
        })


    })
    //当 其他确认按钮点击时
    $('.other_btn').click(function(e){
        e.preventDefault()
        let that = this
        $.ajax({
            url:'http://jk.com/Admin/Project/checkProj',
            type:'post',
            data:{
                pro_id: pro_id
            },
            success:function(data){
                if(data.code==1){

                    let applyIsSet = data.res.applyIsSet
                    let othersIsSet = data.res.othersIsSet

                    if(applyIsSet){
                        $('#success').find('[lll=ApplicationBOX]').children('i').removeClass('icon-cha')
                        $('#success').find('[lll=ApplicationBOX]').children('i').removeClass('success_text_logo_fail')
                        $('#success').find('[lll=ApplicationBOX]').children('i').addClass('icon-dagou4')
                        $('#success').find('[lll=ApplicationBOX]').children('i').addClass('success_text_logo_success')
                    }else{
                        $('#success').find('[lll=ApplicationBOX]').children('i').removeClass('icon-dagou4')
                        $('#success').find('[lll=ApplicationBOX]').children('i').removeClass('success_text_logo_success')
                        $('#success').find('[lll=ApplicationBOX]').children('i').addClass('icon-cha')
                        $('#success').find('[lll=ApplicationBOX]').children('i').addClass('success_text_logo_fail')
                    }

                    if(othersIsSet){
                        $('#success').find('[lll=other]').children('i').removeClass('icon-cha')
                        $('#success').find('[lll=other]').children('i').removeClass('success_text_logo_fail')
                        $('#success').find('[lll=other]').children('i').addClass('icon-dagou4')
                        $('#success').find('[lll=other]').children('i').addClass('success_text_logo_success')
                    }else{
                        $('#success').find('[lll=other]').children('i').removeClass('icon-dagou4')
                        $('#success').find('[lll=other]').children('i').removeClass('success_text_logo_success')
                        $('#success').find('[lll=other]').children('i').addClass('icon-cha')
                        $('#success').find('[lll=other]').children('i').addClass('success_text_logo_fail')
                    }

                    var toBox = $(that).attr('href')
                    $('#main').children(`div[lll]:not(div[lll=${toBox}])`).removeClass('active')
                    $(toBox).addClass('active')
                    $('.establishment_step').find(`a[href=${toBox}]`).addClass('active')
                    $('.establishment_step').find(`a:not([href=${toBox}])`).removeClass('active')

                }
            }
        })

    })

    //最后一步确认按钮点击的时候
    $('#isok').click(function(e){
        // window.sessionStorage['pro_id'] = ''
        pro_id = ''
        window.location.href='lu_ProjectManagement_index.html'
    })
    //当上一步按钮点击确定shi0
    $('.toback_btn').click(function(e){
        e.preventDefault()
        var toBox = $(this).attr('href')
        $('#main').children(`div[lll]:not(div[lll=${toBox}])`).removeClass('active')
        $(toBox).addClass('active')
        $('.establishment_step').find(`a[href=${toBox}]`).addClass('active')
        $('.establishment_step').find(`a:not([href=${toBox}])`).removeClass('active')
    })

    //正则判断
    $('#project_num').blur(function(e){
        let value = $(this).val()
        let reg = /^{0-9}{21}$/
        if(!regCheck(value,reg)){
            $(this).val('')
            $(this).css('border-color','#ff0000')
            // $(this).attr('placeholder','不得小于已折旧月份')
            $('.xmbh_remark_border_text').addClass('active')
        }
    })





    //正则判断函数
    function regCheck(string,reg) {
        if(reg.test(string)){
            return true;
        }
        return false;
    }
/**/
})